package com.ruoyi.web.api;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.request.UpdatePasswordReq;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author liutao
 * @version 1.0
 * @description: TODO
 * @date 2024/3/13 12:38
 */
@RestController
@RequestMapping("/api/user")
public class UserApi {

    @Resource
    private ISysUserService userService;

    @PostMapping("/update/password")
    public R<Boolean> updatePassword(@RequestBody @Validated UpdatePasswordReq req) {
        return R.ok(userService.updatePassword(req));
    }
}
